<?php
namespace App\Library\PHPMailer;
class PHPMailer
{
	protected $mailer;
	protected $host = 'smtp.mxhichina.com';
	protected $username = '0553@atwuhu.com';
	protected $password = 'Gun2damseed';
	public function __construct() {
		$this->mailer = new PHPMailer_Class(true);
		$this->mailer->IsSMTP();
		$this->mailer->CharSet = 'utf-8';
		$this->mailer->Port = 25;
		$this->mailer->Host = $this->host;
		$this->mailer->Username = $this->username;
		$this->mailer->Password = $this->password;
		$this->mailer->SMTPAuth = true;
		//来自谁
		$this->mailer->From = $this->username;
		//来自谁 名称
		$this->mailer->FromName = 'ATWuHu';
		$this->mailer->IsHTML(true);
	}
	/**
	 * 
	 * @param string $address	发送到的地址
	 * @param string $subject	标题
	 * @param string $body		内容
	 */
	public function send($address, $subject, $body) {
		$this->mailer->AddAddress($address);
		$this->mailer->Subject = $subject;
		$this->mailer->Body = $body;
		return $this->mailer->Send();
	}
}
?>